package com.zhu.vo.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.zhu.annotate.Dict;
import com.zhu.converter.DataConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@HeadRowHeight(value = 25) // 头部行高
@ContentRowHeight(value = 15) // 内容行高
@ColumnWidth(value = 20) // 列宽
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 表头样式
@HeadFontStyle(fontName = "黑体")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 内容样式
public class UserExcelVo {

    @ColumnWidth(value = 0)
    @ExcelProperty("用户id")
    private Long uid;

    @ExcelProperty("用户名")
    private String username;

    @Dict(code = "user_gender")
    @ExcelProperty(value = "性别",converter = DataConverter.class)
    private Integer sex;

    @ExcelProperty("联系方式")
    private String phone;

    @ExcelProperty("电子邮箱")
    private String email;

    @Dict(code = "user_status")
    @ExcelProperty("状态")
    private Integer status;

    @ExcelProperty("创建时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ExcelProperty("修改时间")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ExcelProperty("备注信息")
    private String remark;

}
